{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_jypx/template/public/ygcsslist.css">
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
     <li  {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('user')}">全部列表</a></li>
    <li   {if $type=='wait'} class="active" {/if}><a href="{php echo $this->createWebUrl('user',array('type'=>wait,'state'=>1));}">待审核</a></li>
     <li   {if $type=='ok'} class="active" {/if}><a href="{php echo $this->createWebUrl('user',array('type'=>ok,'state'=>2));}">已确认</a></li>
     <li   {if $type=='no'} class="active" {/if}><a href="{php echo $this->createWebUrl('user',array('type'=>no,'state'=>3));}">已拒绝</a></li>
</ul>
<div class="main">
    <div class="panel panel-default">
        <div class="panel-body">
              <form action="" method="get" class="col-md-4">
          <input type="hidden" name="c" value="site" />
          <input type="hidden" name="a" value="entry" />
          <input type="hidden" name="m" value="zh_jypx" />
          <input type="hidden" name="do" value="user" />
            <div class="input-group" style="width: 300px">
                <input type="text" name="keywords" class="form-control" placeholder="请输入学生/家长姓名">
                <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit" value="查找"/>
                </span>
            </div>
            <input type="hidden" name="token" value="{$_W['token']}"/>
           <input type="hidden" name="type" value="all"/>
        </form>
        <div class="col-md-3">
           <!--<a class="btn btn-primary" href="javascript:location.reload()"><i class="fa fa-refresh"></i>刷新</a>-->
           <!--批量部分-->
          <!--<button class="btn btn-default ygshanchu" id="allselect">批量删除</button>-->
          <div class="btn btn-md storesuccess2" id="allpass">批量审核</div>
      </div>
    </div>
</div>
    <div class="panel panel-default">

        <div class="panel-heading">
            用户管理
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
                      <th class="store_td1 col-md-1">
                            <input type="checkbox" class="allcheck" />
                            <span class="store_inp">全选</span>
                        </th>
                        <th class="col-md-1">所在校区</th>
                        <th class="col-md-1">所在学级</th>
                        <th class="col-md-1">所在班级</th>
                        <th class="col-md-1">家长姓名</th>
                        <th class="col-md-1">学生姓名</th>
                        <th class="col-md-1">联系电话</th>
                        <th class="col-md-2">注册时间</th>
                        <th class="col-md-1">注册审核</th>
                        <th class="col-md-2">操作</th>
                    </tr>
                    {loop $list  $row}
                   <tr class="yg5_tr2">
                    <!-- 批量部分 -->
                        <td>
                            <input type="checkbox" name="test" value="{$row['id']}">
                        </td>
                    <!-- 批量部分 -->
                        <td>{$row['cate_name']}</td>
                        <td>{$row['course_name']}</td>
                        <td>{$row['class_name']}</td>
                        <td>{$row['parents_name']}</td>
                        <td>{$row['students_name']}</td>
                        <td>{$row['phone_number']}</td>
                        <td>{$row['create_time']}</td>
                        {if $row['state']==1}
                        <td>
                            <span class="label storered">待审核</span>
                        </td >
                        {elseif $row['state']==2}
                        <td >
                            <span class="label storeblue">已通过</span>
                        </td>
                        {elseif $row['state']==3}
                        <td>
                           <span class="label storegrey">已拒绝</span>
                       </td>
                       {/if} 
                       <td>
                         {if $row['state']==1}
                           <a href="{php echo $this->createWebUrl('user',array('op'=>'tg','id'=>$row['id'],'page'=>$_GPC['page']));}"><button class="btn ygyouhui2 btn-xs">通过</button></a>
                           <a href="{php echo $this->createWebUrl('user',array('op'=>'jj','id'=>$row['id']));}"><button class="btn ygshouqian2 btn-xs">拒绝</button></a>
                           {/if}
                           <a href="{php echo $this->createWebUrl('editorusers', array('id' => $row['id'],'class_id' => $row['class_id']))}" class="storespan btn btn-xs">
                                <span class="fa fa-pencil"></span>
                                <span class="bianji">编辑<span class="arrowdown"></span>
                                </span>
                            
                            </a>
                          <a href="" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">
                              <span class="fa fa-trash-o"></span>
                              <span class="bianji">删除
                                  <span class="arrowdown"></span>
                              </span>
                          </a>
                        <!-- <td> -->
                         
                           <!-- <a href="{php echo $this->createWebUrl('userinfo',array('id'=>$row['id']));}"><button class="btn btn-success btn-xs">查看</button></a>
                           
                           <button type="button" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">删</button> -->
                       <!-- </td> -->
                        <!-- <td> -->
                          <!--<a href="javascript:void(0);" data-toggle="modal" data-target="#myModalb{$row['id']}"><span class="btn btn-xs ygyouhui2">充值余额</span> </a>-->
                          <!--   <a href="{php echo $this->createWebUrl('mypublished',array('id'=>$row['id']));}">
                                <span class="btn btn-xs ygyouhui2">我发布的</span>
                        </a>
                            <a href="{php echo $this->createWebUrl('mypartaked',array('id'=>$row['id']));}">
                                <span class="btn btn-xs ygyouhui2">我参与的</span>
                            </a>
                            <a href="{php echo $this->createWebUrl('myscore',array('id'=>$row['id']));}">
                                <span class="btn btn-xs ygyouhui2">我的信誉</span>
                            </a> -->
                          <!-- <button type="button" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">删除</button>                             -->
                        <!-- </td>                    -->
                    </tr>
                    <!-- <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                        </div>
                        <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('slide', array('op' => 'delete', 'id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div> -->
            <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('user', array('op' => 'delete', 'id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div>
            <!-- <div class="modal fade" id="myModal3{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定要启用么？
                        </div>
                        <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('slide', array('status' => 1, 'op' => 'change', 'id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div> -->
                    {/loop}
                     {if empty($list)}
                      <tr class="yg5_tr2">
                      <td colspan="12">
                            暂无用户信息
                        </td>
                    </tr>
                    {/if}

            
                </table>
            </div>
        </form>
    </div>

</div>
</div>
<div class="text-right we7-margin-top">
   {$pager}
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-12").show();
        $("#yframe-12").addClass("wyactive");
    })

    $("#allpass").on('click',function(){
            var check = $("input[type=checkbox][class!=allcheck]:checked");
            if(check.length < 1){
                alert('请选择要审核的用户!');
                return false;
            }else if(confirm("确认要通过此用户?")){
                var id = new Array();
                check.each(function(i){
                    id[i] = $(this).val();
                });
                console.log(id)
                $.ajax({
                    type:"post",
                    url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=AdoptUser&m=zh_jypx",
                    dataType:"text",
                    data:{id:id},
                    success:function(data){
                        console.log(data);
                        location.reload();
                    }
                })
            }
        });

    $(".allcheck").on('click',function(){
            var checked = $(this).get(0).checked;
            $("input[type=checkbox]").prop("checked",checked);
        });
</script>